import base64
import io

import PIL
import google.generativeai as genai
from PIL import Image

genai.configure(api_key="AIzaSyBJoz7BvdFgWTBwzcu-0xWpJKfEJOR6vPM")
model = genai.GenerativeModel('models/gemini-1.5-pro-latest')


image_path = "C:\\Users\\zhengsj\\Downloads\\门票及园内项目预约攻略.png"


result = model.generate_content([
    "请总结一下这个图片说了什么？用中文回答", PIL.Image.open(image_path)])
print(result.text)